package com.ruoyi.announcement.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.announcement.mapper.AnnouncementMapper;
import com.ruoyi.announcement.domain.Announcement;
import com.ruoyi.announcement.service.IAnnouncementService;

/**
 * 系统公告Service业务层处理
 * 
 * @author anyunyi
 * @date 2025-05-29
 */
@Service
public class AnnouncementServiceImpl implements IAnnouncementService 
{
    @Autowired
    private AnnouncementMapper announcementMapper;

    /**
     * 查询系统公告
     * 
     * @param id 系统公告主键
     * @return 系统公告
     */
    @Override
    public Announcement selectAnnouncementById(Long id)
    {
        return announcementMapper.selectAnnouncementById(id);
    }

    /**
     * 查询系统公告列表
     * 
     * @param announcement 系统公告
     * @return 系统公告
     */
    @Override
    public List<Announcement> selectAnnouncementList(Announcement announcement)
    {
        return announcementMapper.selectAnnouncementList(announcement);
    }

    /**
     * 新增系统公告
     * 
     * @param announcement 系统公告
     * @return 结果
     */
    @Override
    public int insertAnnouncement(Announcement announcement)
    {
        return announcementMapper.insertAnnouncement(announcement);
    }

    /**
     * 修改系统公告
     * 
     * @param announcement 系统公告
     * @return 结果
     */
    @Override
    public int updateAnnouncement(Announcement announcement)
    {
        return announcementMapper.updateAnnouncement(announcement);
    }

    /**
     * 批量删除系统公告
     * 
     * @param ids 需要删除的系统公告主键
     * @return 结果
     */
    @Override
    public int deleteAnnouncementByIds(Long[] ids)
    {
        return announcementMapper.deleteAnnouncementByIds(ids);
    }

    /**
     * 删除系统公告信息
     * 
     * @param id 系统公告主键
     * @return 结果
     */
    @Override
    public int deleteAnnouncementById(Long id)
    {
        return announcementMapper.deleteAnnouncementById(id);
    }
}
